<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript" src="jquery-1.8.2.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		
		if(${sessionScope.mvo==null}){
			alert("로그인 하고오세요");
			opener.document.location.href = "wedding.do?command=loginForm";		
			self.close();
		}
		if(${sessionScope.mvo.userLevel==0 }){
			/* location.href ="qna.do?command=qnaGetContent&qnaNo=${param.qnaNo}&page=${requestScope.page }"; */
			opener.document.location.href = "qna.do?command=qnaGetContent&qnaNo=${param.qnaNo}&page=${requestScope.page }";		
			self.close();
		}
		else{
		$("#passwordCheck").click(function() {
			var passCheck = $("#qnaPassword").val();
			if(passCheck == ""){
				alert("비밀번호 입력해주세요");
				return false;
			}else{
				$.ajax({
					type:"GET",
					url:"qna.do",
					data:"command=qnaCheckPassword&qnaNo=${param.qnaNo }&qnaPassword="+passCheck,
					success : function(data) {	
							if(data.flag==true){
								alert("패스워드 확인완료");
								opener.document.location.href = "qna.do?command=qnaGetContent&qnaNo=${param.qnaNo}";		
								self.close();
							}else{
								alert("패스워드불일치");
							}
					}
				}) // ajax
				} // else
		})// click
		}
	}); // document
</script>
password checked page
<c:if test="${param.qnaRestep == 1 }">
<br>답글 비밀번호는 질문글 의 비빌번호 입니다 ^^
</c:if>
<br>

<input type="password" id="qnaPassword">
<input type="button" id="passwordCheck" value="비밀번호 체크하러가기">

</form>